package model

// SysMenu 系统菜单表
type SysMenu struct {
	BaseModel
	ParentID     uint64     `json:"parentId" gorm:"column:parent_id;comment:父菜单ID"`
	Name         string     `json:"name" gorm:"column:name;type:varchar(100);comment:菜单名称"`
	Path         string     `json:"path" gorm:"column:path;type:varchar(200);comment:路由路径"`
	Component    string     `json:"component" gorm:"column:component;type:varchar(200);comment:组件路径"`
	Redirect     string     `json:"redirect" gorm:"column:redirect;type:varchar(200);comment:重定向地址"`
	Permission   string     `json:"permission" gorm:"column:permission;type:varchar(100);comment:权限标识"`
	Type         string     `json:"type" gorm:"column:type;type:varchar(20);comment:菜单类型(directory/menu/button)"`
	Icon         string     `json:"icon" gorm:"column:icon;type:varchar(100);comment:菜单图标"`
	OrderNum     int        `json:"orderNum" gorm:"column:order_num;comment:显示顺序"`
	Hidden       bool       `json:"hidden" gorm:"column:hidden;comment:是否隐藏"`
	KeepAlive    bool       `json:"keepAlive" gorm:"column:keep_alive;comment:是否缓存"`
	AlwaysShow   bool       `json:"alwaysShow" gorm:"column:always_show;comment:是否总是显示"`
	Target       string     `json:"target" gorm:"column:target;type:varchar(20);comment:打开方式(_blank/_self)"`
	MenuCategory string     `json:"menuCategory" gorm:"column:menu_category;type:varchar(50);comment:菜单分类(system:系统菜单,tenant:租户菜单,common:通用菜单)"`
	CreateBy     string     `json:"createBy" gorm:"column:create_by;type:varchar(64);comment:创建者"`
	UpdateBy     string     `json:"updateBy" gorm:"column:update_by;type:varchar(64);comment:更新者"`
	Children     []*SysMenu `json:"children" gorm:"-"`
}

// TableName 指定表名
func (SysMenu) TableName() string {
	return "sys_menu"
}
